package com.mk.web.controller;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by WangChen on 2018/11/30 13:58.
 */
@Component
public class DemoController2 implements ApplicationContextAware{

    @RequestMapping("demo2")
    public String dome2(){
        System.out.println("demo2...");
        return "demo.jsp";
    }


    ApplicationContext applicationContext;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
        System.out.println(applicationContext);
    }
}
